-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add docs on proto annotations #15548
Conversation
|
||
## Scalars | ||
|
||
(cosmos_proto.scalar) = "cosmos.AddressString"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note to also describe AddressBytes
, ValidatorAddressString/Bytes
and ConsensusAddressString/Bytes
. Basically we want to cover all of what is in the global config and sdk.{Acc/Val/Cons}Address
Closing due to inactivity. I will pick this up after abci++ is merged |
cf5ecf4
to
7699660
Compare
|
||
The amino codec was removed in 0.50.0, this means there is not a need register `legacyAminoCodec`. To replace the amino codec, Amino protobuf annotations are used to provide information to the amino codec on how to encode and decode protobuf messages. | ||
|
||
:::Note |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here.
(cosmos_proto.scalar) = "cosmos.AddressString" | ||
``` | ||
|
||
There are a few options for what can be provided as a scalar: cosmos.AddressString, cosmos.ValidatorAddressString, cosmos.ConsensusAddressString, cosmos.Int, cosmos.Dec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe give an example? It is quite important that the scalar annotations are correct for the addresses as AutoCLI relies on it (otherwise it will just be considered as a string without any validation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you should assume it wont be correct and/or they wont be implemented at all. I can add it but we shouldnt assume its used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it is the role of developer removing their CLI for AutoCLI to verify the annotation. Hence I thought a small mention was useful.
However, AutoCLI will still work without it. Addresses will simply not be verified (if you have an annotation there will be a field verification that you input a valid address).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for sure, added it. It will be hard to get people to adopt this. Many times with proto its write once and forget till you need a change. Adding annotations will be harder to for people to integrate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be more in building modules imho.
c5f12fc
to
0422b08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
(cherry picked from commit c86a6dc)
Co-authored-by: Marko <[email protected]>
Description
ref: #14682
this pr describes various protobuf annotations that have been added over time to make working with protobuf easier for application developers
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change